import { IAddFriendPayload, IChangeFriendGroupParams } from "@/types/friend";
import { IMessageListParams } from "@/types/session";
import request from "@/utils/request.ts";

// 获取添加好友请求列表
export const GetReqFriendList = () => {
  return request.get("/reqFriendList");
};

// 查找好友
export const SearchFriend = (paeams: any) => {
  return request.post("/searchFriend", paeams);
};

// 获取好友详情
export const GetFriendInfo = (FId: number) => {
  return request.get("/getFriendDetail/" + FId);
};

// 添加好友
export const AddFriend = (params: IAddFriendPayload) => {
  return request.post("/addFriend", params);
};

// 同意好友请求
export const AgreeFriend = (params: IMessageListParams) => {
  return request.post("/agreeFriend", params);
};

// 获取好友列表
export const RequestFriendList = () => {
  return request.get("/getFriendList");
};

// 获取好友详情
export const GetFriendDetail = (FriendId: number) => {
  return request.get(`/getFriendDetail/${FriendId}`);
};

// 修改好友的分组
export const ChangeFriendGroup = (params: IChangeFriendGroupParams) => {
  return request.post("/changeFriendGroup", params);
};
